package servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import service.Servicet;
import vo.Books;

@WebServlet("/All")
public class Allservlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private Servicet s = new Servicet();
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		List<Books> list = s.all();
		HttpSession session = request.getSession();
		session.setAttribute("list", list);
		//request.setAttribute("list", list);
		response.sendRedirect("aaa/all.jsp");
		//request.getRequestDispatcher("aaa/all.jsp").forward(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
